{% extends 'base_result.html' %}
{% block content %}
    <div class="header">
        <div class="header-content">
            <h1>基于事件的DAE系统</h1>
            <p class="header-subtitle">基于物理信息的神经网络求解事件驱动的微分代数方程</p>
        </div>
    </div>

    <div class="results-container">
        <a href="{% url 'myweb:index' %}" class="back-link">
            <i class="fas fa-arrow-left"></i> 返回主页
        </a>

        <div class="content-wrapper">
            <!-- 模型公式部分 -->
            <div class="model-section">
                <div class="section-card">
                    <h2 class="section-title">
                        <i class="fas fa-square-root-alt"></i> 数学模型描述
                    </h2>
                    <div class="equation-container">
                        <div class="equation-group">
                            <h3>偏微分方程</h3>
                            <div class="equation">\(\frac{\partial u}{\partial t} = D\nabla^2 u + k(1 - u)v\)</div>
                        </div>

                        <div class="equation-group">
                            <h3>代数约束</h3>
                            <div class="equation">\(u + v = 1\)</div>
                        </div>

                        <div class="equation-group">
                            <h3>初始条件</h3>
                            <div class="equation">\(u(x,0) = \sin(\pi x)\)</div>
                        </div>

                        <div class="equation-group">
                            <h3>边界条件</h3>
                            <div class="equation">\(u(0,t) = 0,\quad u(1,t) = 0\)</div>
                            <div class="equation-note">注: \(\nabla^2 u = \frac{\partial^2 u}{\partial x^2}\)
                                (一维情况)
                            </div>
                        </div>
                    </div>
                </div>
            </div>


            <!-- 可视化结果部分 -->
            <div class="visualization-section">
                <div class="section-card">
                    <h2 class="section-title">
                        <i class="fas fa-chart-line"></i> 数值模拟结果
                    </h2>
                    <div class="image-container">
                        <img src="/static/img/demo3.png" alt="基于事件的DAE系统模拟结果" class="result-image">
                        <div class="image-caption">图1. PINN方法求解高指标DAE的数值模拟结果</div>
                    </div>
                </div>
            </div>

            <!-- 数据表格部分 -->
            <div class="data-section">
                <div class="section-card">
                    <h2 class="section-title">
                        <i class="fas fa-table"></i> 数值对比
                    </h2>
                    <div class="table-container">
                        <div class="table-responsive">
                            <table class="data-table">
                                <thead>
                                <tr>
                                    <th>x坐标</th>
                                    <th colspan="3">变量u</th>
                                    <th colspan="3">变量v</th>
                                </tr>
                                <tr>
                                    <th></th>
                                    <th>PINN</th>
                                    <th>有限差分</th>
                                    <th>误差</th>
                                    <th>PINN</th>
                                    <th>有限差分</th>
                                    <th>误差</th>
                                </tr>
                                </thead>
                                <tbody>
                                <tr>
                                    <td>0.00</td>
                                    <td>0.0129</td>
                                    <td>0.0000</td>
                                    <td class="error-cell">0.0129</td>
                                    <td>0.9231</td>
                                    <td>1.0000</td>
                                    <td class="error-cell">0.0769</td>
                                </tr>
                                <tr>
                                    <td>0.10</td>
                                    <td>0.4997</td>
                                    <td>0.4965</td>
                                    <td class="error-cell">0.0032</td>
                                    <td>0.5099</td>
                                    <td>0.5035</td>
                                    <td class="error-cell">0.0064</td>
                                </tr>
                                <tr>
                                    <td>0.20</td>
                                    <td>0.6933</td>
                                    <td>0.6934</td>
                                    <td class="error-cell">0.0001</td>
                                    <td>0.2967</td>
                                    <td>0.3066</td>
                                    <td class="error-cell">0.0099</td>
                                </tr>
                                <tr>
                                    <td>0.30</td>
                                    <td>0.7858</td>
                                    <td>0.7859</td>
                                    <td class="error-cell">0.0001</td>
                                    <td>0.2076</td>
                                    <td>0.2141</td>
                                    <td class="error-cell">0.0064</td>
                                </tr>
                                <tr>
                                    <td>0.40</td>
                                    <td>0.8293</td>
                                    <td>0.8290</td>
                                    <td class="error-cell">0.0002</td>
                                    <td>0.1683</td>
                                    <td>0.1710</td>
                                    <td class="error-cell">0.0027</td>
                                </tr>
                                <tr>
                                    <td>0.51</td>
                                    <td>0.8414</td>
                                    <td>0.8411</td>
                                    <td class="error-cell">0.0004</td>
                                    <td>0.1555</td>
                                    <td>0.1589</td>
                                    <td class="error-cell">0.0034</td>
                                </tr>
                                <tr>
                                    <td>0.61</td>
                                    <td>0.8268</td>
                                    <td>0.8263</td>
                                    <td class="error-cell">0.0005</td>
                                    <td>0.1687</td>
                                    <td>0.1737</td>
                                    <td class="error-cell">0.0050</td>
                                </tr>
                                <tr>
                                    <td>0.71</td>
                                    <td>0.7799</td>
                                    <td>0.7794</td>
                                    <td class="error-cell">0.0005</td>
                                    <td>0.2190</td>
                                    <td>0.2206</td>
                                    <td class="error-cell">0.0016</td>
                                </tr>
                                <tr>
                                    <td>0.81</td>
                                    <td>0.6827</td>
                                    <td>0.6799</td>
                                    <td class="error-cell">0.0028</td>
                                    <td>0.3268</td>
                                    <td>0.3201</td>
                                    <td class="error-cell">0.0067</td>
                                </tr>
                                <tr>
                                    <td>0.91</td>
                                    <td>0.4757</td>
                                    <td>0.4661</td>
                                    <td class="error-cell">0.0096</td>
                                    <td>0.5470</td>
                                    <td>0.5339</td>
                                    <td class="error-cell">0.0131</td>
                                </tr>
                                </tbody>
                            </table>
                        </div>
                        <div class="table-note">
                            <p><strong>说明：</strong>PINN预测结果与有限差分法(FD)解的对比。误差值展示了PINN方法的准确性。</p>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
{% endblock %}